const fs = require('fs')
const {promisify} = require('util')

const stat = promisify(fs.stat)

async function getDirSize (dirPath, cb) {
  let size = (await stat(dirPath)).size
  cb && cb(size)
}


getDirSize('../', size => {
  console.log("文件夹大小： ", size);
})